Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 6 - Transform Objects / Transform Objects Reference
Functions / Transforming Shapes by Modifying Shape Geometries


GXScaleShape

You can use the GXScaleShape function to scale a shape by specified horizontal and vertical factors about a specified origin.

void GXScaleShape(gxShape target, Fixed hScale, Fixed vScale,
                  Fixed xOffset, Fixed yOffset);
target
A reference to the shape you want to scale.
hScale
The horizontal scaling factor.
vScale
The vertical scaling factor.
xOffset
The horizontal coordinate of the origin to scale the shape about.
yOffset
The vertical coordinate of the origin to scale the shape about.
DESCRIPTION
The GXScaleShape function scales the shape referenced by the target parameter horizontally by the factor specified in the hScale parameter and vertically by the factor specified in the vScale parameter. The scaling is centered about the origin specified in the xOffset and yOffset parameters. (The origin is the point whose coordinates do not change as a result of the scaling operation.)

This function scales the target shape in one of two ways:

The target shape can be any shape type. However, if the target shape is an empty shape, a full shape, or a picture shape, this function has no effect unless the shape's gxMapTransformShape attribute is set.

The coordinates of the origin are specified in geometry space.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
shape_access_not_allowed(debugging version)
Warnings 
scale_shape_out_of_range 
graphic_type_cannot_be_moved 
Notices (debugging version) 
mapping_unaffected 
SEE ALSO
For examples of the use of this function, see Listing 6-4 on page 6-25 and Listing 6-5 on page 6-27.

To scale a shape by altering the mapping property of its transform object, you can also use the GXScaleTransform function, described on page 6-60.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996